﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[spIsEndOfMonth]
#-- Purpose:		Is today the last day of the month.
#--	Last Update:	08/29/2011
#--					For a complete history - please review comments in Version
#--					control.
#-- Called By:		[dbo].[spBackupDifferential]
#------------------------------------------------------------------------------
*/
CREATE PROCEDURE [dbo].[spIsEndOfMonth]
AS
BEGIN
	--- Return the Answer to the Question
	RETURN	(CASE	WHEN CAST(CONVERT(varchar(20), DATEADD(d, -DAY(DATEADD(m,1,GETDATE())),DATEADD(m,1,GETDATE())), 101) as datetime) = CAST(CONVERT(varchar(20), GETDATE(), 101) as datetime)
					THEN 1 ELSE 0 END)
END
